function Base() {
	this.baseFunc = function() {
		print("base behavior");
	}
}

function Middle() {
	this.middleFunc = function() {
		print("middle behavior");
	}
}

Middle.prototype = new Base();
console.log(Middle);

function Final() {
	this.finalFunc = function() {
		print("final behavior");
	}
}
Final.prototype = new Middle();
console.log(Final);

function test() {
	var obj = new Final();
	obj.baseFunc();
	obj.middleFunc();
	obj.finalFunc();
};
test();